//
//  CAIPhotoBrowser.h
//  CAIImagePickerControllerKit
//
//  Created by 海参 on 2022/8/9.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN


@class CAIPhotoBrowser;
@protocol CAIPhotoBrowserDelegate <NSObject>

@optional

/// 选择指定index
-(void)photoBrowser:(CAIPhotoBrowser *)browser didSelectItemAtIndex:(NSInteger)index;

/// 将要展示的时候
-(void)photoBrowser:(CAIPhotoBrowser *)browser willDisplayCellForItemAtIndex:(NSInteger)index;

@end



@interface CAIPhotoBrowser : UIView<UICollectionViewDataSource,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout>


@property (nonatomic, weak) id<CAIPhotoBrowserDelegate>delegate;

@property (nonatomic, copy) NSArray *images;

@property (nonatomic, assign) NSInteger currentImageIndex;


///是否无限循环,默认Yes
@property (nonatomic, assign) BOOL infiniteLoop;

///是否自动滚动,默认Yes
@property (nonatomic, assign) BOOL autoScroll;



@end

NS_ASSUME_NONNULL_END
